# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=py3-setproctitle
_pkgname=setproctitle
pkgver=1.3.3
pkgrel=1
pkgdesc="A Python module to customize the process title"
url="https://github.com/dvarrazzo/py-setproctitle"
arch="all"
license="BSD-3-Clause"
depends="python3"
makedepends="musl-dev py3-gpep517 py3-setuptools py3-wheel python3-dev"
checkdepends="procps-ng py3-pytest"
subpackages="$pkgname-pyc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/dvarrazzo/py-setproctitle/archive/version-$pkgver.tar.gz"
builddir="$srcdir/py-$_pkgname-version-$pkgver"

replaces=py-setproctitle # Backwards compatibility
provides=py-setproctitle=$pkgver-r$pkgrel # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
c07f783dfeed33e01ea0616cfa78c9619f037b622010fc719611a610f9fa97cd85cc62f05480caaf732cc2c1755b013e9acbf229165ced4afc54b2179f1f9bf7  setproctitle-1.3.3.tar.gz
"
